/*
							Copyright (C) 2010  Alourien Team
									
						This file is part of the Alourien Engine.

    The Alourien Engine is free software: you can redistribute it and/or modify
    it under the terms of the GNU Lesser General Public License as published by
    the Free Software Foundation, either version 3 of the License, or
    (at your option) any later version.

    The Alourien Engine is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU Lesser General Public License for more details.

    You should have received a copy of the GNU Lesser General Public License
    along with the Alourien Engine.  If not, see <http://www.gnu.org/licenses/>.
		
 *File Name:Vector2Dimp.cpp
 *Programmer Name:Jose Castellano
 *Date of Last Update: 10/6/2010
 *
 *Purpose:This Program is to create a two dimensional 
 * Vector to be used in later programs
 *
 *Basic Info:It includes the vector set function which allows to
 * set both values at once. Needs the Vector2D header.
 *
 *UPDATES:
 *1)Created the Program and documentation.
 *  Date:10/1/2010 Updater: Jose Castellano
 *
 *2) Added the actual code to our Engine namespace
 *   Date: 10/06/2010 Updater: Manuel Cuellar
 *
 *
 */

#include "Vector2D.h"

namespace Alourien
{
	Vector2D::Vector2D(void)
	{
		x = 0;
		y = 0;
	}


	Vector2D::~Vector2D(void)
	{
	}


	//This function is to get the values and set them into the vector
	//It allows for a faster initialization, rather than setting in the main
	//using two lines of code.
	void Vector2D::VectorSet(float xValue, float yValue)
	{
		x = xValue;
		y = yValue;
	}
	
	//Overload of the + operator but for 2 Dimensional Vectors
	//Returns a 2 dimensional vector
	Vector2D Vector2D::operator+(const Vector2D& vector2) const
	{
		Vector2D tempData;

		tempData.x = this->x + vector2.x;
		tempData.y = this->y + vector2.y;

		return tempData;
	}
	
	//Overload of the * operator but for 2 Dimensional Vectors
	//Returns a 2 dimensional vector
	Vector2D Vector2D::operator*(const Vector2D& vector2) const
	{
		Vector2D tempData;

		tempData.x = this->x * vector2.x;
		tempData.y = this->y * vector2.y;

		return tempData;
	}
}
